package com.yanqu.road.ak13;

import com.yanqu.road.fs8.YanQuWSDecipher;
import com.yanqu.road.hs7.YanQuWSEncrypt;

import io.netty.handler.codec.http.websocketx.WebSocketFrameDecoder;
import io.netty.handler.codec.http.websocketx.WebSocketFrameEncoder;
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker13;

public class YanQuWSH13 extends WebSocketServerHandshaker13 {

	private final boolean allowExtensions0;

	public YanQuWSH13(String webSocketURL, String subprotocols, boolean allowExtensions,
                      int maxFramePayloadLength) {
		super(webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
		this.allowExtensions0 = allowExtensions;
	}

	@Override
	protected WebSocketFrameDecoder newWebsocketDecoder() {
		return new YanQuWSDecipher(true, allowExtensions0, maxFramePayloadLength());
	}

	@Override
	protected WebSocketFrameEncoder newWebSocketEncoder() {
		return new YanQuWSEncrypt();
	}
}
